package com.spring.service.impl;

import com.spring.dao.UserDao;
import com.spring.pojo.User;
import com.spring.service.UserService;

public class UserServiceImpl implements UserService {
    private UserDao userDao;
    // 通过当前类的构造方法，让Spring将UserDao对象添加进来
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
    @Override
    public User getById(Integer id) {
        return userDao.getById(id);
    }
}
